package org.tinaelle.client.utils;

public class Utilities {
	/**
	 * Check if the string is blank or null
	 * 
	 * @param String
	 *            The string to be checked.
	 * @return boolean true if the input string is blank or null, otherwise false
	 * 
	 */
	public static boolean isBlankOrNull(final String str) {
		boolean result = false;
		if ( str == null ) {
			result = true;
		} else {
			result = str.trim().equals( "" ) || str.trim().equals( "null" ) ? true : false;
		}
		return result;
	}

	public static boolean isBlankOrNull(final Object obj) {
		if ( obj == null ) {
			return true;
		} else {
			return isBlankOrNull( obj.toString() );
		}
	}
} // End Class

